package com.team.cluedo.app;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Gallery;
import android.widget.AdapterView.OnItemClickListener;

import com.team.cluedo.Game;
import com.team.cluedo.R;
import com.team.cluedo.app.utils.CluedoMenu;
import com.team.cluedo.app.utils.ImageAdaptater;

public class PlayerCards extends Activity {
	
	private static final int CARD_WIDTH = 85;
	private static final int CARD_HEIGHT = 100;

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		boolean res = CluedoMenu.onCreateOptionsMenu(menu, this);
		return res;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		return CluedoMenu.onOptionsItemSelected(item, this);
	}
	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
	    setContentView(R.layout.threegalleries);
	    
	    Gallery gPerso = (Gallery) findViewById(R.id.gallerycharacter);
	    gPerso.setAdapter(new ImageAdaptater(this,Game.cluedo.mesCartesPerso,CARD_WIDTH,CARD_HEIGHT));
	    gPerso.setOnItemClickListener(new OnItemClickListener() {
	        public void onItemClick(AdapterView parent, View v, int position, long id) {
	            
	        }
	    });
	    
	    Gallery gWeapons = (Gallery) findViewById(R.id.galleryweapon);
	    gWeapons.setAdapter(new ImageAdaptater(this,Game.cluedo.mesCartesPiece,CARD_WIDTH,CARD_HEIGHT));
	    gWeapons.setOnItemClickListener(new OnItemClickListener() {
	        public void onItemClick(AdapterView parent, View v, int position, long id) {
	            
	        }
	    });
	    
	    Gallery gPiece = (Gallery) findViewById(R.id.galleryroom);
	    gPiece.setAdapter(new ImageAdaptater(this,Game.cluedo.mesCartesArme,CARD_WIDTH,CARD_HEIGHT));
	    gPiece.setOnItemClickListener(new OnItemClickListener() {
	        public void onItemClick(AdapterView parent, View v, int position, long id) {
	            
	        }
	    });
	 
	}
}
